import cv2
import numpy as np
# # 读取图像
image = cv2.imread('2.webp', )
if image is None:
     print("Error: Unable to load image.")
     exit()
# # 图像反转
inverted_image = 255 - image
# # 显示原始图像和反转后的图像
cv2.imshow('Original Image', image)
cv2.imshow('Inverted Image', inverted_image)
cv2.waitKey(0)
cv2.destroyAllWindows()